package com.example.searchbackend.model;

/**
 * 性别枚举字段
 * @author ricejson
 */
public enum GenderEnum {
    MALE(0, "男"),
    FEMALE(1, "女")
    ;

    private int value;
    private String description;

    GenderEnum(int value, String description) {
        this.value = value;
        this.description = description;
    }

    public static GenderEnum genGenderEnum(int value) {
        GenderEnum ret = null;
        switch (value) {
            case 0 -> {
                ret = MALE;
            }
            case 1 -> {
                ret = FEMALE;
            }
            default -> {
                ret = null;
            }
        }
        return ret;
    }

    public int getValue() {
        return value;
    }

    public String getDescription() {
        return description;
    }
}
